package org.jeecg.modules.htxincailiao.im.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.htxincailiao.im.entity.IMConversation;
import org.jeecg.modules.htxincailiao.im.entity.IMMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: im_message
 * @Author: jeecg-boot
 * @Date:   2023-03-15 09:48:23
 * @Version: V1.0
 */
public interface IMMessageMapper extends BaseMapper<IMMessage> {


    @Select("<script>" +
            "SELECT * FROM im_message WHERE conversation_id=#{conversationId}" +
            "</script>")
    IMMessage queryBy(@Param("conversationId") String conversationId);


    @Select("<script>" +
            "SELECT * FROM im_message WHERE sender_id=#{senderId} LIMIT 10" +
            "</script>")
    List<IMMessage> queryByLimit(@Param("senderId") String senderId);

}
